import { defineStore } from 'pinia'
const {ipcRenderer} = window.electron
// const dataSourceHandler: DataSource = await ipcRenderer.invoke('dataSourceHandler')
// console.log(dataSourceHandler)
ipcRenderer.invoke('dbQuery', "select * from 'sqlite_master'").then(ipcRenderer=>{
  console.log(ipcRenderer)
})
async function queryHandler(sql: string){
  return await ipcRenderer.invoke('dbQuery', sql)
}
export const useSqliteStore = defineStore('sqlite', {
    state: () => {
        return {

        }
    },

    actions: {
        queryBackendUrl() {
          const res = queryHandler("select backend_url from setting;")
          res.then(res=>{
            console.log(res)
          })
          console.log(res)
        },
    }
})

